package com.jthinker.blog.dao.impl;

import com.jthinker.blog.bean.entity.User;
import com.jthinker.blog.dao.UserDao;
import org.springframework.stereotype.Repository;

/**
 * User: Gang Chen
 * Date: 2015/7/22 20:14
 */
@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<User, Long> implements UserDao
{

    @Override
    public User findByUsername(String username)
    {
        String hql = "from User where username =:username";
        return (User) getSession().createQuery(hql).setString("username", username).uniqueResult();
    }
}
